package com.day17.ex01;

import java.io.File;

public class FileDemo04 {
    public static void main(String[] args) {
        File f=new File("D:\\java\\javaSE\\javaSE\\src\\com\\day17\\ex01\\FileDemo.java");
        System.out.println(f.isDirectory());
        System.out.println(f.isFile());
        System.out.println(f.exists());
        System.out.println(f.getAbsolutePath());
        System.out.println(f.getPath());
        System.out.println(f.getName());
        System.out.println("--------");
        File f2=new File("D:\\java\\javaSE\\javaSE\\src\\com\\day17\\ex01");
        String[] strArray=f2.list();
        for(String str:strArray){
            System.out.println(str);
        }
        System.out.println("--------");
        File[] fileArray=f2.listFiles();
        for(File file:fileArray){
            if(file.isFile()){
                System.out.println(file.getName());
            }
        }
    }
}
